package com.lanchetech.dao;

import com.lanchetech.bean.request.AnchorRankReq;
import com.lanchetech.bean.request.AnchorReq;
import com.lanchetech.bean.vo.AnchorRankVO;
import com.lanchetech.bean.vo.UserInfoVO;
import com.lanchetech.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserInfoMapper {
    int deleteByPrimaryKey(Long id);

    int insert(UserInfo record);

    int insertSelective(UserInfo record);

    UserInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserInfo record);

    int updateByPrimaryKey(UserInfo record);

    int updateIdCardAndRealNameAndUpdatedAtByUserId(UserInfo userInfo);

    UserInfo findOneByUserId(@Param("userId") Long userId);

    int updateAnchorLevelByUserId(@Param("updatedAnchorLevel") Byte updatedAnchorLevel, @Param("userId") Long userId);

    int cancelAnchor(@Param("updatedAnchorLevel") Byte updatedAnchorLevel, @Param("userId") Long userId);

    List<AnchorRankVO> getPopularityRank();

    List<UserInfoVO> findAllAnchorPage(AnchorReq req);

    List<AnchorRankVO> getAreaRank(AnchorRankReq req);

    int updateFansCountbyid(@Param("updatedFansCount") Long updatedFansCount, @Param("id") Long id);

    int updateAttentionCountById(@Param("updatedAttentionCount") Long updatedAttentionCount, @Param("id") Long id);

    Long getPopularityRankNumber(@Param("fansCount") Long fanCount);

    Long getAreaRankNumber(@Param("req") AnchorRankReq req, @Param("fansCount") Long fansCount);

    int updateDescriptionByUserId(@Param("updatedDescription")String updatedDescription,@Param("userId")Long userId);


}